<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>按钮缩放</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }

      li {
        list-style: none;
      }

      img {
        width: 100%;
      }

      .box {
        width: 249px;
        height: 210px;
        margin: 50px auto;
      }
      .box p {
        color: #3b3b3b;
        padding: 10px 10px 0 10px;
      }

      /* 1. 摆放播放按钮：图片区域的中间 */
      .box li {
        overflow: hidden;
      }
      .pic {
        position: relative;
      }
      /* 使用伪元素实现该效果 */
      .pic::after{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%) scale(3);
        opacity: 0;
        transition: all 1s;
        content: url('./images/play.png');
      }
      .box:hover .pic::after{
        transform: translate(-50%,-50%) scale(0.7);
        opacity: 1;
      }
      /* 使用透明度与缩放实现该效果 */
      /* .play {
        transition: all 1s;
        position: absolute;
        top: 50%;
        left: 50%;
        width: 15%;
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
      } */
      /* display属性没有动画效果--直接销毁元素 */
      /* display: none; */
      /* .pic:hover .play {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
      } */
    </style>
  </head>

  <body>
    <div class="box">
      <ul>
        <li>
          <div class="pic">
            <img src="./images/party.jpeg" alt="" />
            <!-- <img src="./images/play.png" alt="" class="play" /> -->
          </div>
          <p>【和平精英】“初火”音乐概念片：四圣觉醒......</p>
        </li>
      </ul>
    </div>
  </body>
</html>
